<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="__JQ__"></script>
    <script src="__JQ_PLUGIN__/validation/jquery.validate.min.js"></script>
    <script src="__JQ_PLUGIN__/validation/messages_zh.js"></script>
</head>
<body>
<form action="" id="addStudent">
    <fieldset>
        <legend>学生信息</legend>
        <p>姓名<input type="text"  name="sname"></p>
        <p>邮箱 <input type="email" name="email"></p>
        <p>密码 <input type="password" name="pwd"></p>
        <p>确认密码 <input type="password" name="pwd2"></p>
        <!--<p>头像<input type="file" name="file"></p>-->
        <p><input type="submit" value="保存"></p>
    </fieldset>
</form>
<script>
    $(function(){
        $('#addStudent').validate({
            rules:{
                sname:{
                    required:true,
                    minlength:2
                },
                email:{
                    required:true,
                    email:true
                },
                pwd:{
                    required:true,
                    minlength: 5
                },
                pwd2:{
                    equalTo:'[name=pwd]'
                },

            }
        });
    });
</script>
</body>
</html>